<?php echo $result?>

				
					
			<div id="content">
				<div id="left">
					<div id="page-title"><?php echo $title_for_layout?></div>
												
					<div id="main-news-description">
						<?php echo $data?>
					</div>
					
					<div>
						<div style="float:left;"><g:plusone size="medium" annotation="none"></g:plusone></div>
						<div style="float:left;margin-left:10px;" class="fb-like" data-href="<?php echo $this->Seo->link('/homes/about');?>" data-send="false" data-layout="button_count" data-width="10" data-show-faces="true"></div>
						<div style="clear:both;height:20px"></div>
					</div>		
				</div>	
				<!-- other news -->
				<div id="right">
					<form name="frmcontact" id="frmcontact" action="<?php echo $this->Seo->link('/homes/about');?>" method="Post">
						<div class="others_title">Phản hồi tới SCY</div>
						<div style="height:20px"></div>
						<div class="label">Họ tên (<font style="color:#e92323">*</font>)</div>
						<div class="input"><input name="name"></input></div>
						<div style="clear:both;height: 5px;"></div>
						<div class="label">Email (<font style="color:#e92323">*</font>)</div>
						<div class="input"><input name="email"></input></div>
						<div style="clear:both;height: 5px;"></div>
						<div class="label">Số ĐT</div>
						<div class="input"><input name="phone"></input></div>					
						<div style="clear:both;height: 5px;"></div>
						<div class="label" style="margin-top:20px;font-weight:bold;">Nội dung (<font style="color:#e92323">*</font>)</div>
						<div class="input"><textarea name="content"></textarea></div>
						<div class="label" style="margin-top:10px">(<font style="color:#e92323">*</font>) thông tin bắt buộc nhập</div>
						<a href="javascript:;" onclick="checkForm();"><div class="btn" style="margin-top:10px;width:30px;float:right">Gửi</div></a>
						<div style="clear:both;"></div>
						
						<div style="height:20px"></div>
						<div class="others_title">Thông tin liên hệ</div>
						<div id="contact-content">
							<div><?php echo $contact?></div>
						</div>
					</form>
					<div style="clear:both;"></div>
				</div>			
									
	<div style="clear:both;"></div>
</div>
					
	<script type="text/javascript">
function checkForm(){		
	var frm=document.getElementById("frmcontact");
	var checkEmail = frm.email.value;
	if(empty(frm.name.value)){
		alert("<?php echo _resource('name is required')?>");
		frm.name.focus();
				
	}else if(!validateEmail(frm.email.value)){
		alert("<?php echo _resource('invalid email')?>");
		frm.email.focus();
						
	}else	if(empty(frm.phone.value)){		
		alert("<?php echo _resource('phone is required')?>");
		frm.phone.focus();
		
	}else	if(empty(frm.content.value)){		
		alert("<?php echo _resource('contact content is required')?>");
		frm.content.focus();
		
	}else{		
		frm.submit();
	}	
}

function validateEmail(id)
{
	var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/;
	return emailPattern.test(id);

}




function doSubmit(){
	if(checkForm()){
		document.getElementById("frmcontact").submit();
	}
}


function empty(str){
	var temp="";
	var len=0;
	temp=str;
	while(len!=temp.length){
		len=temp.length;
		temp=temp.replace(" ","");
		temp=temp.replace("\r","");
		temp=temp.replace("\n","");
	}
	if(temp=="")return true;
	return false;
}


//google
(function() {
  var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
  po.src = 'https://apis.google.com/js/plusone.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
//facebook
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

</script>				
